<?php
/**
* @file $Id: DrawStudentHeader.fnc.php 437 2007-04-23 00:57:51Z focus-sis $
* @package Focus/SIS
* @copyright Copyright (C) 2006 Andrew Schmadeke. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.txt
* Focus/SIS is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.txt for copyright notices and details.
*/
function DrawStudentHeader()
{	global $_FOCUS;
	$programs = array('Students/Student.php'=>_('Demographic Info'),'Scheduling/Schedule.php'=>_('Schedule'),'Scheduling/Requests.php'=>_('Requests'),'Grades/StudentRCGrades.php'=>_('Grades'),'Attendance/StudentSummary.php'=>_('Absences'),'Eligibility/Student.php'=>_('Activities & Eligibility'),'Discipline/Referrals.php'=>'Referrals','Billing/StudentFees.php'=>_('Fees'),'Billing/StudentPayments.php'=>_('Payments'));
	foreach($programs as $modname=>$title)
	{
		if(AllowUse($modname))
		{
			if($_REQUEST['modname']!==$modname)
			{
				$tabcolor = 'DFDFDF';
				$textcolor = '666666';
			}
			else
			{
				$tabcolor = Preferences('HIGHLIGHT');
				$textcolor = 'FFFFFF';
			}
			if($modname=='Discipline/Referrals.php')
				$modname .= '&search_modfunc=list&&student_header=true&stuid='.UserStudentID();
	
			$header .= '<TD width=10></TD><TD>'.DrawTab($title,'Modules.php?modname='.$modname.'&LO_index='.$_REQUEST['LO_index'],$tabcolor,$textcolor,'_circle',array('tabcolor'=>Preferences('HIGHLIGHT'),'textcolor'=>'FFFFFF')).'</TD>';
		}
	}

	if(isset($_REQUEST['LO_index']))
	{
		$tmp_REQUEST = $_REQUEST;
		unset($tmp_REQUEST['LO_index']);
		unset($tmp_REQUEST['values']);
		unset($tmp_REQUEST['address_id']);
		unset($tmp_REQUEST['person_id']);
		// since StudentRCGrades has issues with the MP tabs ... this probably applies to any program, but why chance it...
		if($_REQUEST['modname']=='Grades/StudentRCGrades.php')
			unset($tmp_REQUEST['search_modfunc']);
		$right = '<TABLE cellspacing=2><TR>';
		if($_REQUEST['LO_index']>1)
		{
			if($_FOCUS['direction']=='RTL')
				$right .= '<TD><A HREF='.PreparePHP_SELF($tmp_REQUEST).'&LO_index='.($_REQUEST['LO_index']-1).'><IMG SRC=assets/arrow_right.gif border=0></A></TD>';
			else
			$right .= '<TD><A HREF='.PreparePHP_SELF($tmp_REQUEST).'&LO_index='.($_REQUEST['LO_index']-1).'><IMG SRC=assets/arrow_left.gif border=0></A></TD>';
		}
		$right .= '<TD>'.button('dot','C9C9C9','','8').'</TD>';
		if($_REQUEST['LO_index']<count($_SESSION['student_list']))
		{
			if($_FOCUS['direction']=='RTL')
				$right .= '<TD><A HREF='.PreparePHP_SELF($tmp_REQUEST).'&LO_index='.($_REQUEST['LO_index']+1).'><IMG SRC=assets/arrow_left.gif border=0></A></TD>';
			else
			$right .= '<TD><A HREF='.PreparePHP_SELF($tmp_REQUEST).'&LO_index='.($_REQUEST['LO_index']+1).'><IMG SRC=assets/arrow_right.gif border=0></A></TD>';
		}
		$right .= '</TR></TABLE>';
	}
	else
		unset($_SESSION['student_list']);


	if(User('PROFILE')=='admin' || User('PROFILE')=='teacher')
		echo TabsHeader($header,$right);
}

?>